package P283;

/**
 * @Author DJ同学
 * @Date 2021/2/22 8:43
 * @Version 1.0
 * @Name 移动零
 * @Problem https://leetcode-cn.com/problems/move-zeroes/
 */
public class Solution {
    public void moveZeroes(int[] nums) {
        int cur=0;
        for(int i=0;i<nums.length;i++){
            if(nums[i]!=0){
                nums[cur++]=nums[i];
            }
        }
        for(int i=cur;i<nums.length;i++){
            nums[i]=0;
        }
    }
}
